package com.lemon.lemonai.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Description: TODO
 * @Author: lemon
 * @CreateTime: 2025-03-22  11:35
 * @Version: 1.0
 */
@Configuration
public class MVCConfiguration implements WebMvcConfigurer {

    @Override
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/**")
                .allowedOrigins("*")
                .allowedHeaders("*")
                .allowedMethods("PUT", "GET", "POST", "DELETE", "OPTIONS")
                .exposedHeaders("Content-Disposition"); //暴露响应头Content-Disposition
    }
}
